home *** CD-ROM | disk | FTP | other *** search
/ The Scorpion King Cardz / The Scorpion King Cardz - Disc 3 - Balthazar.iso / pc / assets / scorp_photos.dxr / 00013_parent_oPhotosNavNodes.ls < prev    next >
Encoding:
Text File  |  2002-03-18  |  3.8 KB  |  107 lines

  1. property pMyListPosition, pWidth, pHeight, pMyRect, pAngle, pMyState, pMyPoint, pMyImage, pObjLoc, pPrevObjLoc, pBlendLevel, pTargetAngle, pSpinDir, pWheelSoundFlag
  2. global oPhotosNavCenter, gScreenNum, oPhotosNavNodes, oOrbitNodes, gPhotosNavNum, gMenuNum, gPhotosState, oLetters
  3.  
  4. on new me, listPosition
  5.   pMyListPosition = listPosition
  6.   case pMyListPosition of
  7.     1:
  8.       pAngle = 90
  9.       pMyImage = member("photos_button1_off").image.duplicate()
  10.     2:
  11.       pAngle = 315
  12.       pMyImage = member("photos_button2_off").image.duplicate()
  13.     3:
  14.       pAngle = 0
  15.       pMyImage = member("photos_button3_off").image.duplicate()
  16.     4:
  17.       pAngle = 45
  18.       pMyImage = member("photos_button4_off").image.duplicate()
  19.     5:
  20.       pAngle = 135
  21.       pMyImage = member("photos_button5_off").image.duplicate()
  22.     6:
  23.       pAngle = 180
  24.       pMyImage = member("photos_button6_off").image.duplicate()
  25.   end case
  26.   pWidth = pMyImage.width
  27.   pHeight = pMyImage.height
  28.   pMyPoint = orbitObj(oPhotosNavCenter.pMyPoint[1], oPhotosNavCenter.pMyPoint[2], pAngle, oPhotosNavCenter.pRadius)
  29.   pMyRect = rect(pMyPoint[1] - (pWidth / 2), pMyPoint[2] - (pHeight / 2), pMyPoint[1] + (pWidth / 2), pMyPoint[2] + (pHeight / 2))
  30.   pObjLoc = pMyRect
  31.   pPrevObjLoc = pObjLoc.duplicate()
  32.   pMyState = #idle
  33.   pBlendLevel = 100
  34.   pTargetAngle = EMPTY
  35.   pSpinDir = 1
  36.   pWheelSoundFlag = 0
  37.   return me
  38. end
  39.  
  40. on movePhotosButtons me
  41.   case pMyState of
  42.     #birth:
  43.       pAngle = pAngle + oPhotosNavCenter.pRotateVel
  44.       if pAngle = 360 then
  45.         pAngle = 0
  46.       end if
  47.       if (pAngle = pTargetAngle) and (oPhotosNavCenter.pRadius >= oPhotosNavCenter.pMinRadius) then
  48.         pMyState = #idle
  49.       end if
  50.       pMyPoint = orbitObj(oPhotosNavCenter.pMyPoint[1], oPhotosNavCenter.pMyPoint[2], pAngle, oPhotosNavCenter.pRadius)
  51.       pMyRect = rect(pMyPoint[1] - (pWidth / 2), pMyPoint[2] - (pHeight / 2), pMyPoint[1] + (pWidth / 2), pMyPoint[2] + (pHeight / 2))
  52.       pPrevObjLoc = pObjLoc.duplicate()
  53.       pObjLoc = pMyRect
  54.     #idle:
  55.       spinCheck = 0
  56.       repeat with i = 1 to count(oPhotosNavNodes)
  57.         if oPhotosNavNodes[i].pMyState = #spin then
  58.           spinCheck = 1
  59.         end if
  60.       end repeat
  61.       if spinCheck = 0 then
  62.         sound(5).stop()
  63.       end if
  64.       if (the mouseLoc).inside(pMyRect) and (spinCheck = 0) then
  65.         gPhotosNavNum = pMyListPosition
  66.         gMenuNum = EMPTY
  67.         repeat with i = 1 to count(oPhotosNavNodes)
  68.           oPhotosNavNodes[i].pMyState = #roll
  69.         end repeat
  70.         oPhotosNavCenter.pMyState = #roll
  71.         sound(3).play(member("nav_bio_roll"))
  72.       end if
  73.     #roll:
  74.       if (the mouseLoc).inside(pMyRect) then
  75.         gPhotosNavNum = pMyListPosition
  76.         gMenuNum = EMPTY
  77.       end if
  78.       cursor(280)
  79.     #spin:
  80.       if pAngle = pTargetAngle then
  81.         pMyState = #idle
  82.         gPhotosState = 1
  83.         exit
  84.       end if
  85.       pAngle = pAngle + (oPhotosNavCenter.pRotateVel * pSpinDir)
  86.       if pAngle >= 360 then
  87.         pAngle = 0
  88.       end if
  89.       if pAngle < 0 then
  90.         pAngle = 350
  91.       end if
  92.       pMyPoint = orbitObj(oPhotosNavCenter.pMyPoint[1], oPhotosNavCenter.pMyPoint[2], pAngle, oPhotosNavCenter.pRadius)
  93.       pMyRect = rect(pMyPoint[1] - (pWidth / 2), pMyPoint[2] - (pHeight / 2), pMyPoint[1] + (pWidth / 2), pMyPoint[2] + (pHeight / 2))
  94.       pPrevObjLoc = pObjLoc.duplicate()
  95.       pObjLoc = pMyRect
  96.     #exit:
  97.       pAngle = pAngle + oPhotosNavCenter.pRotateVel
  98.       pMyPoint = orbitObj(oPhotosNavCenter.pMyPoint[1], oPhotosNavCenter.pMyPoint[2], pAngle, oPhotosNavCenter.pRadius)
  99.       pMyRect = rect(pMyPoint[1] - (pWidth / 2), pMyPoint[2] - (pHeight / 2), pMyPoint[1] + (pWidth / 2), pMyPoint[2] + (pHeight / 2))
  100.       pPrevObjLoc = pObjLoc.duplicate()
  101.       pObjLoc = pMyRect
  102.       if pBlendLevel > 0 then
  103.         pBlendLevel = pBlendLevel - 5
  104.       end if
  105.   end case
  106. end
  107.